/**
 * Project Name:cnsy-url-short-service
 * File Name:RequestContext.java
 * Package Name:cn.cnsy123.shorturls.business.localuser 
 * Date: 2020年4月21日-下午11:13:21
 * Copyright (c) 2020, yangpengfei@360@126.com All Rights Reserved. 
 *
 */

package cn.cnsy123.shorturls.business.localuser;


/**
 * ClassName: RequestContext
 * 
 * @author yangpengfei
 * @date 2020年4月21日-下午11:13:21
 * @version 1.0
 * @since JDK 1.7
 */
public class RequestContext {
    
    private static final ThreadLocal<ConsoleUserVo> CACHE_USER = new ThreadLocal<ConsoleUserVo>();
    
    public static  ConsoleUserVo get(){
        return CACHE_USER.get();
    }
    
    public static  void set(ConsoleUserVo value) {
        if(CACHE_USER.get() == null) {
            CACHE_USER.set(value);
        }
        
    }

    public static void clear() {
        CACHE_USER.remove();
    }
}
